The constructor invoked may be either another auxiliary constructor or the primary constructor, and it must be the first statement in the auxiliary constructor's body.
被调用的构造函数可以是另外一个辅助构造函数或者主构造函数,而且它必须出现在辅助构造函数主体的第一句。
Traits don't support auxiliary constructors, nor do they accept an argument list for the primary constructor, the body of a trait.
Traits不支持辅助构造函数,它们也不支持在主构造函数,trait的主体里的参数列表。
Because all auxiliary constructors eventually invoke the primary constructor, logic checks and other initializations done in the body will be performed consistently for all instances created.
因为所有的辅助构造函数最终都会调用主构造函数,它主体中进行的逻辑检查和其它初始化工作会在所有实例被创建的时候执行。
应用推荐